package com.lagou.edu.mvcframework.context;

/**
 * @author liuc
 * @date 2021/4/22
 * @description 记录当前请求的用户角色
 **/
public class PermissionContext {
    private static ThreadLocal<String> username = new InheritableThreadLocal<>();

    public static String getUsername(){
        return username.get();
    }

    public static void setUsername(String name){
        username.set(name);
    }

    public static void clear(){
        username.remove();
    }
}
